import { createRouter,createWebHashHistory} from "vue-router";

const login = () => import('../components/login/login.vue')
const main = () => import('../components/main/main.vue')
const container = () => import('../components/main/container.vue')
const mineQuestion = () => import('../components/main/minequestionnaire.vue')
const recycleBin = () => import('../components/main/recycleBin.vue')
const create = () => import('../components/create/create.vue')
const statistics = () => import('../components/statistics/statistics.vue')
const usedquestion = () => import('../components/statistics/usedquestion.vue')

export const router = createRouter({
    history: createWebHashHistory(),
    routes: [
        { path: '/', redirect: '/login' },
        {
            path: '/login',
            name: 'login',
            component: login
        },
        {
            path: '/main',
            name: 'main',
            component: main,
            children: [
                {
                    path: '/container',
                    name: 'container',
                    component: container,
                    children: [
                        {
                            path: '/mineQuestion',
                            name: 'mineQuestion',
                            component: mineQuestion
                        },
                        {
                            path: '/recycleBin',
                            name: 'recycleBin',
                            component: recycleBin
                        }
                    ],
                    redirect: '/mineQuestion'
                },
                {
                    path: '/create',
                    name: 'create',
                    component: create
                },
                {
                    path: '/statistics',
                    name: 'statistics',
                    component: statistics
                },
                {
                    path: '/usedquestion',
                    name: 'usedquestion',
                    component: usedquestion
                }
            ],
            redirect: '/container'
        },
    ]
})

export default router;
